package com.songlanyun.modules.shareconfig.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 会员分享提成配置表
 * 
 * @author zx
 * @date 2021年3月4日 09:47:20
 */
@Data
@TableName("yxt_system_share_config")
public class SystemShareConfig extends RootEntity<Integer, SystemShareConfig> implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	private Integer id;
	/**
	 * 是否开启分享
	 */
	@NotNull(message = "是否开启分享提成不能为空")
	private Boolean isShare;
	/**
	 * 是否开启APP分享
	 */
	@NotNull(message = "是否开启APP分享提成不能为空")
	private Boolean isAppShare;
	/**
	 * 是否开启小程序分享
	 */
	@NotNull(message = "是否开启小程序分享提成不能为空")
	private Boolean isAppletsShare;
	/**
	 * 会员分享提成比例
	 */
	@NotNull(message = "会员分享提成比例不能为空")
	@DecimalMin(value = "0.1",message = "会员分享提成比例最小0.1%")
	@DecimalMax(value = "50",message = "会员分享提成比例最大50%")
	private BigDecimal userShareRatio;
	/**
	 * 网红分享提成比例
	 */
	@NotNull(message = "网红分享提成比例不能为空")
	@DecimalMin(value = "0.1",message = "网红分享提成比例最小0.1%")
	@DecimalMax(value = "50",message = "网红分享提成比例最大50%")
	private BigDecimal netRedShareRatio;
	/**
	 * 会员打开分享商品链接，与分享人关系保持的有效时间
	 */
	@NotNull(message = "会员打开分享商品链接，与分享人关系保持的有效时间不能为空")
	@Range(min = 1,max = 90,message = "分享有效时间最少1天最多90天")
	private Integer userShareValidTime;
	/**
	 * 商家id
	 */
	@NotNull(message = "商家id不能为空")
	private Long shopId;

	@Override
	public Integer getIdentity() {
		return this.id;
	}
}
